/**
  ******************************************************************************
  * @file    usbd_usr.c USBD_MSC_DEMO_USER_CALLBACKS
  ******************************************************************************/

/* Includes ------------------------------------------------------------------*/
#include "usbd_usr.h"
#include  "lcd_log.h"
#include "test_program.h"
    
#include <stdio.h>

    
  extern __IO _flags flags;  

/*  Points to the DEVICE_PROP structure of current device */
/*  The purpose of this register is to speed up the execution */

USBD_Usr_cb_TypeDef USR_cb =
{
  USBD_USR_Init,
  USBD_USR_DeviceReset,
  USBD_USR_DeviceConfigured,
  USBD_USR_DeviceSuspended,
  USBD_USR_DeviceResumed,
  
  USBD_USR_DeviceConnected,
  USBD_USR_DeviceDisconnected,    
};


/**
* @brief  Displays the message on LCD on device lib initialization
* @param  None
* @retval None
*/
void USBD_USR_Init(void)
{

//#ifdef USE_USB_OTG_HS 
//  LCD_LOG_SetHeader(" SDRAM Disk test");
//#else
//  LCD_LOG_SetHeader(" SDRAM Disk test");
//#endif
  LCD_UsrLog("> USB device library started.\n"); 
//  LCD_LOG_SetFooter (" Device ready" );
  
 
}

/**
* @brief  Displays the message on LCD on device reset event
* @param  speed : device speed
* @retval None
*/
void USBD_USR_DeviceReset (uint8_t speed)
{
/*  
 switch (speed)
 {
   case USB_OTG_SPEED_HIGH: 
     LCD_LOG_SetFooter (" Device ready [HS]" );
     break;

  case USB_OTG_SPEED_FULL: 
     LCD_LOG_SetFooter (" Device ready [FS]" );
     break;
 default:
     LCD_LOG_SetFooter (" Device ready [??]" );
     
 }
 
  LCD_UsrLog("> Reset\n");
  */
}


/**
* @brief  Displays the message on LCD on device config event
* @param  None
* @retval Staus
*/
void USBD_USR_DeviceConfigured (void)
{
  LCD_UsrLog("> MSC Interface started.\n");

}
/**
* @brief  Displays the message on LCD on device suspend event 
* @param  None
* @retval None
*/
void USBD_USR_DeviceSuspended(void)
{
 //   LCD_UsrLog("> Device In suspend mode.\n");

}


/**
* @brief  Displays the message on LCD on device resume event
* @param  None
* @retval None
*/
void USBD_USR_DeviceResumed(void)
{
//    LCD_UsrLog("> Device resumed.\n");
}

/**
* @brief  USBD_USR_DeviceConnected
*         Displays the message on LCD on device connection Event
* @param  None
* @retval Staus
*/
void USBD_USR_DeviceConnected (void)
{
  LCD_UsrLog("> USB Device Connected.\n");
}


/**
* @brief  USBD_USR_DeviceDisonnected
*         Displays the message on LCD on device disconnection Event
* @param  None
* @retval Staus
*/
void USBD_USR_DeviceDisconnected (void)
{
  LCD_UsrLog("> USB Device Disconnected.\n");
  
     flags.saving_ramdisk_image = 1;

}
